package  com.sat.common.network

import retrofit2.Call
import retrofit2.Response
import java.util.*

class RetrofitTools {
    private fun a() {}
    class Request {
        private var tag: Any? = null
        fun cancelTag(tag: Any?): Request {
            this.tag = tag
            return this
        }

        fun <T, R> call(
            serviceClazz: Class<T>?,
            mListener: OnMethodCall<T, R>?
        ): Request {
            return this
        }

        fun execute(): Response<*>? {
//            T service = RetrofitFactory
//                    .getRetrofit()
//                    .create(clazz);
//            Call call = mListener.getCall(service);
//            mAllCalls.put(tag,call);
            return null
        }
    }

    interface OnMethodCall<T, R> {
        fun getCall(service: T): Call<R>?
    }

    companion object {
        private val mAllCalls =
            HashMap<Any, Call<*>>()

        fun newRequest(): Request {
            return Request()
        }
    }
}